# -*- coding:utf-8 -*-
from PySide6.QtWidgets import (QHBoxLayout, QLineEdit, QPushButton, QGroupBox)

class ProtoGroup(QGroupBox):
    def __init__(self):
        """
        proto 文件所在路径设置
        """
        super().__init__(" Proto文件目录设置")
        # 水平布局
        proto_layout = QHBoxLayout()
        self.proto_path_input = QLineEdit()
        self.proto_path_input.setPlaceholderText("Proto文件目录...")
        self.proto_path_input.setReadOnly(True)
        proto_layout.addWidget(self.proto_path_input, 7)

        self.proto_btn_choose = QPushButton("选择目录")
        proto_layout.addWidget(self.proto_btn_choose)
        self.setLayout(proto_layout)
    
    def set_language(self, lang_data):
        """设置语言"""
        self.setTitle(lang_data.get("proto_title", "Proto路径设置"))
        self.proto_btn_choose.setText(lang_data.get("select_dir", "选择目录"))
        self.proto_path_input.setPlaceholderText(lang_data.get("proto_path_placeholder", "Proto命令所在目录..."))